﻿using System.Reflection;

namespace AuSys.Utils.Reflection
{
    public static class TypeSearcher
    {
        public static List<Type> Search<T>(Assembly? asm = null)
        {
            var targetType = typeof(T);
            asm = Assembly.GetExecutingAssembly();
            var targets = asm.GetTypes()
                .Where(x => !x.IsAbstract)
                .Where(targetType.IsAssignableFrom)
                .ToList();
            return targets;
        }
    }
}
